package hello;
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import javax.microedition.lcdui.*;
import javax.microedition.lcdui.game.*;
import java.util.*;



/**
 *
 * @author THANH PHUC
 */
public class NhanhLua extends Sprite{
    static final int WIDTH = 16;
    static final int HEIGHT = 16;
    static String path = "/images/BomberFires/H";
    private int trans;
    private int myInitialX;
    private int myInitialY;
    //static Image H1,H2,H3,H4;
        
    public NhanhLua(int x, int y, int TRANS)throws Exception
    {

        super(Image.createImage("/images/BomberFires/H2.gif"), 
	  WIDTH, HEIGHT);
        trans = TRANS;
        setTransform(trans);
        myInitialX = x;
        myInitialY = y;
        
        //defineReferencePixel(WIDTH/2, 0);
        //setRefPixelPosition(myInitialX, myInitialY);  
        setPosition(myInitialX, myInitialY);
        defineCollisionRectangle(0, 0, 30, 40);
    }
    public int num = 1;
    void andvance()
    {
         String filepath  = path + String.valueOf(num)+ ".gif" ;
         
       //  if(num <=3)
       //  {
             try {
                setImage(Image.createImage(filepath),WIDTH , HEIGHT);
               // setPosition(myInitialX, myInitialY);
                num = num+2;
            } catch (Exception exception) {
            }
         //}        
    }
}
